package uqbar.comm.netty.arduino;

public enum DigitalValue {
	HIGH, LOW;

	public boolean asBoolean() {
		return this == DigitalValue.HIGH;
	}

	public int asInt() {
		return this.asBoolean() ? 1 : 0;
	}

	public static DigitalValue from(final boolean value) {
		return value ? HIGH : LOW;
	}
}
